﻿



 
using HBase;
using hCommand; 
using Persistence;
using System;
using System.Collections.Generic;

namespace Controller
{
    public class SimulationParamCreateIn :ZtTask {
        ICoreStockServer coreStockServer = null;
        List<DateTime> list = new List<DateTime>();
        Random rd = new Random((int)DateTime.Now.Ticks);
        protected override bool onlyOneTimeAsync() {
             coreStockServer = WMSDalFactray.getDal<ICoreStockServer>();
       
            for (int i = 0; i < 50; i++) {
                list.Add(DateTime.Now.AddMinutes(rd.Next(-50,0)));
            }
            time = 60000;
            return true;
        }

   
        public override bool excute() {
          /*
            for (int i = 2301; i <= 2350; i++) {

               long m= (DateTime.Now .Ticks- list[i - 2301].Ticks)/10000/1000/60-50;
                if (m < rd.Next(-10, 10)) {
                    continue;
                }

                TaskPool.doWork<WcsLoadUp>();
                String code = (i + 10000).ToString();
                CoreStock  cs = coreStockServer.getCoreStockByCode(code);
                if (cs!=null&&cs.status!=-1) {
                     continue;
                }
            
                TaskCarrier task = BaseTask.getByCode<TaskCarrier>("", i);
                if (task != null  ) {
                    continue;
                }

                TransRes result = WMSTransactionFacade.doStockInEngine(code, i);
                if (result.s) {
                    TaskPool.doWork<WcsLoadUp>();
                } else {
                    LoggerCommon.consol(result.msg);

                }

            }


            */
            return true;
        }


      
    }
}
